/**
 * 版权所有(C)，上海海鼎信息工程股份有限公司，2006，所有权利保留。
 * 
 * 项目名：	rumba
 * 文件名：	EntityChangeLog.java
 * 模块说明：	
 * 修改历史：
 * 2006-5-16 - lxm, zhangyanbo - 创建。
 */
package com.hd123.rumba.log;

import com.hd123.rumba.exception.StringTooLongException;

/**
 * @author lxm
 * @author zhangyanbo
 * 
 */
public class EntityChangeLog extends EntityLog implements IEntityChangeLog {
  private String fieldName;
  private String fieldCaption;
  private String oldValue;
  private String newValue;

  public String getFieldCaption() {
    return fieldCaption;
  }

  public void setFieldCaption(String fieldCaption) throws StringTooLongException {
    if (fieldCaption != null)
      fieldCaption = CEntityChangeLog.truncate(fieldCaption, CEntityChangeLog.LENGTH_FIELDCAPTION,
          "fieldCaption", CEntityChangeLog.CAPTION_FIELDCAPTION);
    this.fieldCaption = fieldCaption;
  }

  public String getFieldName() {
    return fieldName;
  }

  public void setFieldName(String fieldName) throws StringTooLongException {
    if (fieldName != null)
      fieldName = CEntityChangeLog.truncate(fieldName, CEntityChangeLog.LENGTH_FIELDNAME,
          "fieldName", CEntityChangeLog.CAPTION_FIELDNAME);
    this.fieldName = fieldName;
  }

  public String getNewValue() {
    return newValue;
  }

  public void setNewValue(String newValue) throws StringTooLongException {
    if (newValue != null)
      newValue = CEntityChangeLog.truncate(newValue, CEntityChangeLog.LENGTH_NEWVALUE, "newValue",
          CEntityChangeLog.CAPTION_NEWVALUE);
    this.newValue = newValue;
  }

  public String getOldValue() {
    return oldValue;
  }

  public void setOldValue(String oldValue) throws StringTooLongException {
    if (oldValue != null)
      oldValue = CEntityChangeLog.truncate(oldValue, CEntityChangeLog.LENGTH_OLDVALUE, "oldValue",
          CEntityChangeLog.CAPTION_OLDVALUE);
    this.oldValue = oldValue;
  }

}
